<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.dic.service.WorddictionaryService"%>
<%@ page import="com.dic.dao.*"%>
<%@ page import="com.dic.dao.model.*"%>

<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    
    String subject=request.getParameter("subject");
    WorddictionaryService ser = new WorddictionaryService();
    List<String> list=ser.getSubjectNum(subject);
    
    //System.out.println("aa"+subject);
    
    
    if(list==null ||list.size()==0){
         //System.out.println("bb"+list==null);
         out.print("{'from':'0','end':'0'}");
    }else if(list.size()==1){
        //System.out.println("cc:"+list.size());
        //System.out.println(list.get(0)+" ;"+list.get(list.size()));
        out.print("{'from':'" + list.get(0) + "','end':'" + list.get(0) + "'}");
    }else{
        //System.out.println("dd:"+list.size());
        out.print("{'from':'" + list.get(0) + "','end':'" + list.get(list.size()-1) + "'}");
    }
    
    
 %>








